const express = require('express');
const { getBannerList, updateBanner } = require('../service/bannerService');
const { formatResponse } = require('../utils/tool');
const router = express.Router();

// 获取首页标语
router.get('/', async function (req, res, next) {
  let result = await getBannerList();
  res.send(formatResponse(0, "获取成功", result));
});

// 修改首页标语
router.post('/', async function (req, res, next) {
  let result = await updateBanner(req.body);
  res.send(formatResponse(0, "修改成功", result));
});

module.exports = router;